import {get, post,del}from '../utils/request';

export const loadCartAPI=()=>get('/api/v1/shop_carts');

/**
 * 
 * @param {*} data
 * product(商品id)  amount(购买商品)  price(单价) 
 * @returns 
 */
export const addToCartAPI=(data)=>post('/api/v1/shop_carts',data);
/**
 * 从购物车删除数据
 * @param {*} id 
 * @returns 
 */
export const delFromCartByIdAPI=id=>del(`/api/v1/shop_carts/${id}`);